package br.ufrj.dcc.mapaviolencia.util;

import java.text.ParseException;
import java.util.List;

import twitter4j.Status;
import twitter4j.Twitter;
import twitter4j.TwitterException;
import twitter4j.TwitterFactory;
import br.ufrj.dcc.mapaviolencia.business.TwitterBusiness;

public class TwitterUtil {
	
	public static final String TWITTER_G1RIO = "g1rio";
	
	public static List<Status> getUserTimeline(String screenName) throws TwitterException {  
	    Twitter twitter = TwitterFactory.getSingleton();
	    List<Status> statuses = twitter.getUserTimeline(screenName);
	    System.out.println("Showing home timeline.");
	    for (Status status : statuses) {
	        System.out.println(status.getUser().getName() + ":" +status.getText());
	    }
		return statuses;
	}  
	
	public static void main(String[] args) throws TwitterException, ParseException {
		TwitterBusiness twitterBusiness = new TwitterBusiness();
		twitterBusiness.removeAllTweets(DBUtil.COLLECTION_TWEETS_G1RIO);
	}
}
